#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/8/26 10:03:49
# @File           : crud.py
# @IDE            : PyCharm
# @desc           : 问题反馈 - 增删改查

from sqlalchemy.ext.asyncio import AsyncSession
from core.crud import DalBase
from . import models, schemas
from apps.dispatch.rule.crud import RuleDal


class TaskFeedbackDal(DalBase):
    def __init__(self, db: AsyncSession):
        super(TaskFeedbackDal, self).__init__()
        self.db = db
        self.model = models.DCTaskFeedback
        self.schema = schemas.TaskFeedbackSimpleOut

    def get_category_options(self):
        datas = RuleDal(self.db).get_datas(
            limit=0,
            rule_type="问题反馈",
            v_schema=schemas.TaskFeedbackOptionsOut
        )
        return datas